/*!
 *
 * \file    Mxd0250Config.h
 *
 * \brief    SDK config header file.
 *
 * Header file of the config declaration about MIRA CMMB Demod SDK
 *
 * \par    Include files
 * - Mxd0250Config.h
 *
 * \par    Copyright (c) 2008 Maxscend Technologies Inc. All rights reserved
 *
 * PROPRIETARY RIGHTS of Maxscend Technologies Inc. are involved in
 * the subject matter of this material.  All manufacturing, reproduction,
 * use, and sales rights pertaining to this subject matter are governed
 * by the license agreement.  The recipient of this software implicitly
 * accepts the terms of the license.
 *
 * \version
 * Revision of last commit: $Rev:: 4                                        $
 * Author of last commit  : $Author:: maxscend\chaohui.jiang                $
 * Date of last commit    : $Date:: 2008-11-17 15:45:38 +0800 (星期?$
 *
 */
#ifndef __MIRA_CONFIG_H__
#define __MIRA_CONFIG_H__

#ifdef __cplusplus
extern "C"
{
#endif

    typedef enum{
        MXD_I2C = 0,
        MXD_SPI,
        MXD_TS,
    } MXD_HW_INTERFACE;

    typedef enum{
        MXD_SPI_MOTO_M0 = 0,
        MXD_SPI_MOTO_M1,
        MXD_SPI_MOTO_M2,
        MXD_SPI_MOTO_M3,
        MXD_SPI_TI_MODE,
    } MXD_SPI_MODE;

    typedef enum{
        MXD_TS_30_MODE = 0,
        MXD_TS_15_MODE,
    } MXD_TS_BANDWIDTH;

    typedef enum{
        MXD_TS_LSB_MODE = 0,
        MXD_TS_MSB_MODE,
    } MXD_TS_BYTEMODE;

    typedef enum{
        MXD_TS_NEGEDGE = 0,
        MXD_TS_POSEDGE,
    } MXD_TS_TRIGEEDAGE;

    typedef enum{
        MXD_TS_SERIAL = 0,
        MXD_TS_PARALLEL,
    } MXD_TS_PARAMODE;

    typedef enum{
        MXD_INT_LOW_ACTIVE = 0,
        MXD_INT_HIGH_ACTIVE,
    } MXD_INT_LEVEL;

    typedef struct
    {
        MXD_HW_INTERFACE eControlPath;   // using which interface for read/write register for mira.
        MXD_HW_INTERFACE eDataPath;   // using which interface for read cmmb data from mira.
        MXD_BOOL bTunerI2cBypass;  // Tuner I2C bypass mode enabled
        MXD_UINT8 nI2cSlaveAddress; // I2c Slave Address
        MXD_SPI_MODE eSpiMode; // Spi mode
        MXD_UINT16 nSpiBitrate; // Spi Bitrate in khz
        MXD_TS_BYTEMODE eTsByteMode; // Ts Byte Mode
        MXD_TS_TRIGEEDAGE eTsTrigeEdage; // Ts Trige Edage
        MXD_TS_PARAMODE eTsParaMode;
        MXD_TS_BANDWIDTH eTsBandWidth;
        MXD_UINT8 nIntType;// 0: interrupt using spi/sdio mac protocol: interrupt not using spi/sdio mac protocol
        MXD_INT_LEVEL eIntLevel;
        MXD_UINT8 nAntennaAdcI2cAddr;
    } MXD_DEVICE_CONFIG;

#define SPI_BURST_LEN  4000
#define STC_REF_THLD 5000
#define SNR_ITER_THRD_FACTOR 80
#define SNR_BLER_THRD_FACTOR 30
#define SNR_ALPHA_FACTOR 2
#define BLER_THLD 20

#if 0 //by david for cmcc performance test
#define LONG_TIME_RECOVERY_THLD 20000
#else
#ifdef MIRA_OAL_FUNC_IMP
int LONG_TIME_RECOVERY_THLD = 3000;
#else
extern int LONG_TIME_RECOVERY_THLD;
#endif
#endif

//#define USE_EXTERNAL_DEMUXER

//#define APPEND_ACC_HEADER_IN_DEMUXER

#define SENDOUT_AV_UNIT_IN_RTP_FORMAT

#define DOUBLE_TV_MEM

#define ESG_FILES_IN_CURRENT_PATH

#define CMMBUNIT_STORAGE_UNITLIST_LEN 4000
#define CMMBUNIT_STORAGE_UNITLIST_ARRAY_LEN 2

//#define __SPI_CHECK__
#ifdef USE_ANTENNA_DAC
    typedef struct
    {
        MXD_UINT32 nFreq;
        MXD_UINT8 nValue;
    } MXD_ANTENNA_REG_TAB;
    extern MXD_ANTENNA_REG_TAB g_AntennaTab[];
#endif

#ifdef __cplusplus
}
#endif

#endif /* __MIRA_CONFIG_H__ */
